package com.mate.cloud.gateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;

import javax.annotation.Resource;

@SpringBootApplication
public class MateGatewayApplication {

    public static void main(String[] args) {
        SpringApplication.run(MateGatewayApplication.class, args);
    }

    /**
     * 负载均衡能力
     */
    @Resource
    LoadBalancerClient loadBalancerClient;


//    @EventListener
//    public void getUri() {
//        ServiceInstance instance = loadBalancerClient.choose("mate-user");
//        System.out.println(instance.getUri());
//    }
}
